1. Field of the Invention
The invention relates generally to the field of multiprocessor parallel processing systems. More particularly, the invention relates to multiprocessor parallel processing systems configured with globally accessible shared memory apparatus.
2. Discussion of the Related Art
A shared memory unit is made up in two general areas as an atomic complex and a shared memory area.xe2x80x9d The atomic complex is further subdivided into a lock complex, doorbell complex, and miscellaneous area.
The lock complex is merely an array of shared memory unit memory locations that provide a xe2x80x9ctest and setxe2x80x9d like operation on a 32 bit object or memory word. When the shared memory unit receives a read request for one of these objects it returns the data to the requester. In addition, if the least significant bit (LSB) of the data is a binary 0 the shared memory unit sets the LSB to a 1 in its copy of the data. Thus any future reads of this object will return a 1 in the LSB of the data. If the LSB is already a 1 then the shared memory unit just returns the data and does nothing to its copy. When a requester sees that the data returned has the LSB cleared or 0 it can assume any future reads, by other hosts attached to the shared memory unit, will return a 1 in the LSB thus creating an element with xe2x80x9ctest and setxe2x80x9d locking heuristics. The LSB stays set until the first reader, the one that read the element where the LSB was 0, writes a binary 0 back to the element thus clearing this test and set lock.
With this primitive the shared memory area of the shared memory unit can be broken up into many pieces that can each be accessed atomically by team members as long as they acquire a lock prior to accessing each area. For example, in shared memory there can be a doubly linked list of widget structures. Widget structures are added to the list by some team members and removed by others. Since each team member is running asynchronously with respect to each other and they all have access to this list the team must be very careful when changing the list. Only one team member may change the list at a time. This is accomplished by acquiring the lock above, modifying the list and releasing the lock when the list is updated. When one team member owns the lock all other team members that want the lock must wait. These waiting team members are usually in a state where they can do nothing else until it is their turn to update the list, thus wasting valuable CPU cycles. As the number of team members increase, the lock contention increases geometrically to a point where adding team members to the team no longer adds to the performance of the team.
The present invention overcomes the above limitation and others by describing methods and apparatus wherein a shared memory unit can be used to eliminate the above discussed problems in the prior art. In addition, methods for dynamically expanding the capabilities of a shared memory unit to deliver various functions are disclosed.
There is a need for the following embodiments. Of course, the invention is not limited to these embodiments.
According to an aspect of the invention, a method comprises: permitting a plurality of central processing units to simultaneously read data stored in a first shared memory address, the first shared memory address being accessed by a first central processing unit; receiving a request to read the first shared memory address from a second central processing unit; receiving a request to read the first shared memory address from a third central processing unit; determining a relationship between data stored in the first shared memory address and data stored in a second shared memory address; determining a relationship between data stored in the first shared memory address and data stored in a third shared memory address; transforming the data stored in the second shared memory address to a form equivalent to that of the data stored in the first shared memory address; transforming the data stored in the third shared memory address to a form equivalent to that of the data stored in the first shared memory address; permitting the second central processing unit to access data stored in the second shared memory address; and permitting the third central processing unit to access data stored in the third shared memory address. According to another aspect of the invention, a method, comprises: providing a queue of activity to a central processing unit, the queue of activity residing in the shared memory unit; receiving a request from a central processing unit via the queue of activity to move a block of shared memory, the block of shared memory residing in the shared memory unit; moving the block of shared memory as desired by the central processing unit; and notifying the central processing unit upon completion of the move of the block of shared memory. According to another aspect of the invention, a method, comprises: providing a queue of activity to a central processing unit, the queue of activity residing in the shared memory unit; receiving a request from a central processing unit via the queue of activity to update data stored in a shared memory address, the request including an old value and a new value; if the old value received from the central processing unit matches a data stored in the shared memory address, updating the data stored in the shared memory address to the new value; and then notifying the central processing unit of a successful update of the data stored in the shared memory address to the new value. According to another aspect of the invention, a method, comprises permitting a shared memory unit to control a plurality of central processing units attempting to traverse a data structure stored in the shared memory unit. According to another aspect of the invention, an apparatus comprises: a central processing unit; and a shared memory unit coupled to the central processing unit, the shared memory unit including a data structure and a queue of activity documenting shared memory accesses by the central processing unit of the shared memory unit.
These, and other, embodiments of the invention will be better appreciated and understood when considered in conjunction with the following description and the accompanying drawings. It should be understood, however, that the following description, while indicating various embodiments of the invention and numerous specific details thereof, is given by way of illustration and not of limitation. Many substitutions, modifications, additions and/or rearrangements may be made within the scope of the invention without departing from the spirit thereof, and the invention includes all such substitutions, modifications, additions and/or rearrangements.